All Questions
Tagged with springdomain-driven-design
15 questions
2votes
2answers
448views
How should I implement data access with jpa to meet Clean Architecture/DDD
For the last few days I'm searching any information about compatibility of JPA and Clean Architecture/DDD. I found next ideas for decoupling application from hibernate. Do not use @ManyToMany or @...
1vote
0answers
66views
Best practice: slightly different logic on multi mapping endpoint
Suppose I've got a spring controller as follows: ⋮ @RestController public class MyController { ⋮ @PostMapping(value = { "publicAPI/addItem", "internalAPI/addItem" }) ...
6votes
3answers
653views
Hexagonal Architecture + Domain Driven Design. How to perform a correct implementation?
Currently, I am trying to implement these two architectures together with Java and Spring (although technology shouldn't matter I think). But I'm encountering problems getting them to work together. I ...
0votes
2answers
221views
Where perform mapping in strict Domain-Driven Design?
I want to create an example application where we use a strict domain-driven design and layering (controller, service, repository). Most notably, we have a clear distinction between the domain and the ...
0votes
1answer
126views
Where to put getOrSave responsibility?
I have many repeated parts of service logic which just fetches object if it exists or returns a newly saved one. I want to move it from service because it just clutters up the logic. But I do not ...
2votes
3answers
917views
How can I avoid duplicate annotations when validating both Entity and DTOs?
I am using the Spring Boot framework to create a RESTFUL API and I need a way to avoid the duplication of validation rules when using multiple DTOs as request/response objects for my endpoints. Using ...
1vote
2answers
846views
Confusion about layered architecture
Given a layered architecture consisting of presentation layer business logic layer data (access) layer and a SPA web application communicating through REST endpoints with the backend (eg Angular and ...
9votes
1answer
2kviews
How to achieve both: clean (hexagonal) architecture with JPA goodies?
How do I achieve two things at the same time writing Java Spring Application: Clean Architecture JPA goodies (@Transactional, Optimistic Locking, dirty checking, etc.) I like the idea of database/...
0votes
5answers
2kviews
performance suggestions on Aggregate root containing thousands of child entities
I understand that DDD is a design concept and implementation through ORMs are tricky but help me understand how would you solve this problem? So here is my confusion on changing on aggregates only ...
3votes
2answers
5kviews
How do entities, DTO, DOA work together and what’s their role within a system?
Most of my work is written in Java using Spring Boot. In a recent project my entities contained no business logic, Spring Data was used to handle repositories and I have service classes that ...
5votes
3answers
3kviews
Handling domain errors in the API
I'm working on building an API interface on-top of a domain-driven architecture. The domain layer has a bunch of specific exception classes (i.e. NameIsRequiredException, CannotPublishDraftException, ...
3votes
1answer
21kviews
Project Structure of Domain Driven Design in maven Java Spring-Boot [closed]
My team is in dilemma, we have an existing maven spring-boot Java8 project with following onion architechture. controller --> service --> dao --> jpa repositories ...
0votes
1answer
769views
In implementing layered API architecture with Spring MVC Boot, how to connect to various endpoints
If you want to implement a layered API design for example, you may have one API layer that represents the application layer. And I assume that the application layer is represented by an endpoint and ...
19votes
3answers
8kviews
DDD - Is anemic domain model an antipattern? Shoud we be using rich domain models? [closed]
Anemic domain model was criticized a long time ago by Evans and Fowler, since apparently it goes against object oriented principles, etc. The DDD community is clearly aligned with this statements. ...
4votes
1answer
1kviews
Does the Spring Data Repository implementation violate the principle of loose coupling?
So, at the moment I find myself building my c#/.net (web) application ( or folder/project/package-...) structure often like this, thinking about it in a "somewhat onion-architectural way": myApp -...